package HomeWork2;

public class Test01 {
    public static void main(String[] args) {
        Phone phone=new Phone("小米",3998,"黑色");
        phone.call();
        phone.sendMessage();
    }
}

class Phone{
    //品牌(brand),价格(price)和颜色(color)三个属性
    private String brand;
    private int price;
    private String color;
    //空参构造器
    public Phone(){

    }
    //有参构造器
    public Phone(String brand,int price,String color){
        this.brand=brand;
        this.price=price;
        this.color=color;
    }
    //提供set/get方法
    public String getBrand() {
        return brand;
    }
    public void setBrand(String brand) {
        this.brand = brand;
    }
    public double getPrice() {
        return price;
    }
    public void setPrice(int price) {
        this.price = price;
    }
    public String getColor() {
        return color;
    }
    public void setColor(String color) {
        this.color = color;
    }
    //打电话call()和sendMessage()两个功能
    public void call(){
        System.out.println("正在使用价格为3998元黑色的小米手机打电话....");
    }
    public void sendMessage(){
        System.out.println("正在使用价格为3998元黑色的小米手机发短信....");
    }
}